<?php

class Default_CountryguideController extends Zend_Controller_Action
{
    public function indexAction()
    {
    	$lang = Zend_Registry::get('lang');
    	$countryId = $this->getRequest()->getParam("country");
    	$db_region = new Default_Model_DbTable_Region();
    	$regions  = $db_region->getregion($countryId,$lang);
    	$this->view->country = $countryId;
    	$this->view->region = $regions;
    }
    public function spotAction()
    {
    	////// get langague ///////////////
    	$lang = Zend_Registry::get('lang');
    	
    	////// get param ///////////////////////
    	$countryId = $this->getRequest()->getParam("country");
    	$regionId = $this->getRequest()->getParam("region");
    	
    	////////// get page ///////////////
    	$page = $this->_getParam('page',1);
    	
    	////// find region //////////////
    	$db_spot = new Default_Model_DbTable_Spot();
    	$spot = $db_spot->getspot($regionId, $lang, $page);
    	
    	/////// assign to client ////////////
   		$this->view->spot = $spot;
   		$this->view->country = $countryId;	 	
    }
    public function spotdetailAction()
    {
    	////// get langague ///////////////
    	$lang = Zend_Registry::get('lang');
    	
    	////// get param ///////////////////////
    	$countryId = $this->getRequest()->getParam("country");
    	$spotId = $this->getRequest()->getParam("spotId");
    	
    	$db_spotdetail = new Default_Model_DbTable_Spotdetail();
    	$sportdetail = $db_spotdetail->getspotdetail($lang);
    	
    	$db_spot = new Default_Model_DbTable_Spot();
    	$spot = $db_spot->getspotId($spotId, $lang);
    	/////// assign to client ////////////
   		$this->view->country = $countryId;	 	
   		$this->view->spotdetail = $sportdetail;
   		$this->view->spot = $spot;
    	
    }
    public function accommodationAction(){
    	////// get langague ///////////////
    	$lang = Zend_Registry::get('lang');
    	
    	////// get param ///////////////////////
    	$countryId = $this->getRequest()->getParam("country",1);
    	$spotId = $this->getRequest()->getParam("spotId",0);
    	$regionId = $this ->getRequest()->getParam("regionId",0);
    	$cityId = $this->getRequest()->getParam("cityId",0);
    	$rate = $this->getRequest()->getParam("rate",0);
    	$page = $this->getRequest()->getParam("page",1);
    	$meeting = $this->getRequest()->getParam("meeting",0);
    	$db_hotel = new Default_Model_DbTable_Hotel();
    	$db_region = new  Default_Model_DbTable_Region();
    	$hotel = $db_hotel->getallhotel($lang, $countryId, $cityId, $regionId, $spotId, $rate,$meeting, $page);
    	
    	////// assign to client ////////
    	$this->view->region = $db_region->getregion($countryId,$lang);
    	$this->view->hotel = $hotel;
    	$this->view->regionId = $regionId;
    	$this->view->country = $countryId;
    	$this->view->cityId = $cityId;
    	$this->view->rate = $rate;
    }
	public function interestAction(){
    	////// get langague ///////////////
    	$lang = Zend_Registry::get('lang');
    	
    	////// get param ///////////////////////
    	$countryId = $this->getRequest()->getParam("country");
    	$spotId = $this->getRequest()->getParam("spotId");
    	$regionId = $this ->getRequest()->getParam("regionId",0);
    	$cityId = $this->getRequest()->getParam("cityId",0);
    	$page = $this->getRequest()->getParam("page",1);
    	
  		$db_interest = new Default_Model_DbTable_Interest();
  		$interest = $db_interest->getallinterest($lang, $countryId, $cityId, $regionId, $spotId, $page);
    	
    	$this->view->regionId = $regionId;
    	$this->view->country = $countryId;
    	$this->view->cityId = $cityId;
    	$this->view->interest = $interest;
    	
    }
	public function restaurantAction(){
    	////// get langague ///////////////
    	$lang = Zend_Registry::get('lang');
    	
    	////// get param ///////////////////////
    	$countryId = $this->getRequest()->getParam("country");
    	$spotId = $this->getRequest()->getParam("spotId");
    	$regionId = $this ->getRequest()->getParam("regionId",0);
    	$cityId = $this->getRequest()->getParam("cityId",0);
    	$page = $this->getRequest()->getParam("page",1);
    	
  		$db_restaurant = new Default_Model_DbTable_restaurant();
  		$restaurant = $db_restaurant->getallrestaurant($lang, $countryId, $cityId, $regionId, $spotId, $page);
    	
    	$this->view->regionId = $regionId;
    	$this->view->country = $countryId;
    	$this->view->cityId = $cityId;
    	$this->view->restaurant = $restaurant;
    }
	public function shoppingAction(){
    	////// get langague ///////////////
    	$lang = Zend_Registry::get('lang');
    	
    	////// get param ///////////////////////
    	$countryId = $this->getRequest()->getParam("country");
    	$spotId = $this->getRequest()->getParam("spotId");
    	$regionId = $this ->getRequest()->getParam("regionId",0);
    	$cityId = $this->getRequest()->getParam("cityId",0);
    	$page = $this->getRequest()->getParam("page",1);
    	
  		$db_shopping = new Default_Model_DbTable_shopping();
  		$shopping = $db_shopping->getallshopping($lang, $countryId, $cityId, $regionId, $spotId, $page);
    	
    	$this->view->regionId = $regionId;
    	$this->view->country = $countryId;
    	$this->view->cityId = $cityId;
    	$this->view->shopping = $shopping;
    }
	public function transportationAction(){
    	////// get langague ///////////////
    	$lang = Zend_Registry::get('lang');
    	
    	////// get param ///////////////////////
    	$countryId = $this->getRequest()->getParam("country");
    	$spotId = $this->getRequest()->getParam("spotId");
    }
    
}